package com.shujia.controller;

import com.shujia.dao.UserDaoInerace;
import com.shujia.service.UserServiceInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserServiceInterface userServiceInterface;


    /**
     * http://localhost/login?username=root&password=123456
     */
    @RequestMapping("/login")
    public String Login(String username, String password) {
        String login = userServiceInterface.login(username, password);
        return login;
    }


    /**
     * http://localhost/register?username=root&password=123456&password1=123456
     */
    @RequestMapping("/register")
    public String register(String username, String password, String password1) {
        String register = userServiceInterface.register(username, password, password1);
        return register;
    }
}
